Skip to content

refactor: initial adjustments#1

Merged
andreynering merged 7 commits intomainfrom
initial-adjustments
Aug 29, 2025
Merged

refactor: initial adjustments#1
andreynering merged 7 commits intomainfrom
initial-adjustments

Conversation

@andreynering
Copy link
Copy Markdown
Member

@andreynering andreynering commented Aug 29, 2025

General adjustments and fixes as I review the codebase.

I advice to review commits individually.

The most relevant changes are:

refactor: move each provider into its own package

Reasoning for this is:

  1. Users can import only those they want, and the Go compiler won't compile the external library the user don't need.
  2. This simplify the API and makes it follow the Go conventions better:
    • ai.NewOpenAiProvider -> openai.New
    • ai.WithOpenAiAPIKey -> openai.WithAPIKey
    • etc.

refactor: change provider options structs to be private / internal

These struct types don't make sense to be part of the public API. They are only used internally to map options to the actual provider SDKs.

@andreynering andreynering self-assigned this Aug 29, 2025
* Check errors where we weren't checking them
* Exit with status 1 on errors
Reasoning for this is:

1. Users can import only those they want, and the Go compiler won't
  compile the external library the user don't need.
2. This simplify the API and makes it follow the Go conventions better:
  * `ai.NewOpenAiProvider` -> `openai.New`
  * `ai.WithOpenAiAPIKey` -> `openai.WithAPIKey`
  * etc.
These struct types don't make sense to be part of the public API. They
are only used internally to map options to the actual provider SDKs.
@andreynering andreynering marked this pull request as ready for review August 29, 2025 20:42
@andreynering
Copy link
Copy Markdown
Member Author

I’ll merge this to unblock further work. Still open for reviews as we can address changes on main if needed.

@andreynering andreynering merged commit 7712c19 into main Aug 29, 2025
16 checks passed
@andreynering andreynering deleted the initial-adjustments branch August 29, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants